package com.enjoyor.soa.traffic.core.efoms.mapper.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.core.efoms.constant.VideoGroupInfoSqlId;
import com.enjoyor.soa.traffic.core.efoms.constant.VideoRelationInfoSqlId;
import com.enjoyor.soa.traffic.core.efoms.domain.VideoGroupInfo;
import com.enjoyor.soa.traffic.core.efoms.domain.VideoRelationInfo;
import com.enjoyor.soa.traffic.core.efoms.mapper.IVideoRelationInfoMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;
import com.enjoyor.soa.traffic.util.pojo.Page;


@Service
@Transactional
public class VideoRelationInfoMapper extends BaseMapper<VideoRelationInfo> implements IVideoRelationInfoMapper{

	@Override
	public Page getIVideoRelationInfoPage(Page page) {
		// TODO Auto-generated method stub
		return this.selectPageInfo(getSqlName(VideoRelationInfoSqlId.SQL_SELECT_ALL), page);
	}

	@Override
	public List<VideoRelationInfo> getIVideoRelationInfoList(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectList(getSqlName(VideoRelationInfoSqlId.SQL_SELECT_LIST), map);
	}

	@Override
	public int deleteVideoRelationInfoByGroupId(String videoGroupId) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.delete(getSqlName(VideoRelationInfoSqlId.SQL_DEL_BY_GROUP_ID), videoGroupId);
	}

	@Override
	public int deleteVideoReletionByGroupIdAndVideoId(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.delete(getSqlName(VideoRelationInfoSqlId.SQL_DEL_BY_GROUPID_AND_VIDEOID), map);
	}

}
